package com.foreknow.demo8;

public class TestMethod {
    public void m1(int a){
        System.out.println(a);
    }

    public int m2(){
        return 12;
    }
    public void m7(Student student){
        System.out.println(student.getName()+"---"+student.getAge());
    }

    public Student m8(Student student){
        return student;
    }

    public boolean m9(A a,String username,String password){
        return a.login(username, password);
    }

    public int m10(X x,Student student){
        return x.add(student);
    }

    public X m11(){
        return null;
    }
    public Student[] m12(Student[] students){
        return students;
    }

    public static void main(String[] args) {
        TestMethod testMethod = new TestMethod();
        Student[] students = new Student[3];
        for (int i = 1 ;i <= students.length;i++){
            Student student = new Student();
            student.setId(i);
            student.setName(Integer.toString(i));
            student.setAge(i*10);
            students[i - 1] = student;
        }
        Student[] stus = testMethod.m12(students);
        for (Student stu :
                stus) {
            System.out.println(stu.getId()+"---"+stu.getName()+"---"+stu.getAge());
        }
        /*X x = new XImpl();
        Student student = new Student();
        student.setId(10);
        student.setName("张三");
        student.setAge(18);
        int isRight = testMethod.m10(x, student);
        if (isRight == 1){
            System.out.println("success......");
        }else if (isRight == 0)
            System.out.println("error......");*/
        /*A a = new B();
        boolean isRight = testMethod.m9(a, "tom", "123456");
        if (isRight)
            System.out.println("登录成功！");
        else
            System.out.println("登录失败！");*/

        /*Student student = new Student();
        student.setName("张三");
        student.setAge(11);
        Student stu = testMethod.m8(student);
        System.out.println(student.getName()+"---"+student.getAge());*/
//        testMethod.m7(student);
//        testMethod.m1(12);
//        int num = testMethod.m2();
//        System.out.println(num);
    }
}
